package com.example.demo.controller;

import com.example.demo.domain.Result;
import com.example.demo.domain.dto.ChatDTO;
import com.example.demo.service.ChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.*;

/**
 * 聊天
 * @author kisofdeath
 * @date 2022-05-11 12:28
 */
@CrossOrigin
@RestController
@RequestMapping("/_api/chat")
public class ChatController {
	@Qualifier("pyChatService")
	@Autowired
	private ChatService chatService;

	@PostMapping()
	public Result<String> test(@RequestBody ChatDTO c) throws Exception {
		return Result.ok(chatService.getChatRespText(c));
	}

}
